Socket
Socket
Sign inDemoInstall

druxt-entity

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

druxt-entity

Drupal Display Mode powered Entity, Form and Field Druxt components.


Version published
Weekly downloads
170
decreased by-16.67%
Maintainers
1
Weekly downloads
 
Created
Source

DruxtEntity

npm CircleCI Known Vulnerabilities codecov

Drupal Display Mode powered Entity, Form and Field Druxt components.

Install

$ npm install druxt-entity

Nuxt.js

Add module to nuxt.config.js

module.exports = {
  modules: ['druxt-entity'],
  druxt: {
    baseUrl: 'https://demo-api.druxtjs.org',
    entity: {
      component: {
        fields: false,
      },
      query: {
        schema: true,
        fields: ['path', 'title'],
      },
    },
  },
}

Usage

DruxtEntity component

The DruxtEntity component renders content entities using Drupal's View display modes.

<DruxtEntity :type="resourceType" :uuid="uuid" :mode="displayMode" />

Example DruxtEntity component

See the DruxtEntity API Documentation for more information.

DruxtEntityForm component

The DruxtEntityForm component uses Drupal's Form displays modes for content creation and editing.

<DruxtEntityForm :type="resourceType" :mode="displayMode" />

Example DruxtEntityForm component

See the DruxtEntityForm API Documentation for more information.

Theming

Both components can be themed by providing a default template:

<DruxtEntity type="node--page" :uuid="uuid">
  <template #default="{ entity, fields, schema }">
    {{ entity }}
  </template>
</DruxtEntity>

The module also provides Wrapper components with scoped slots for theming:

<template>
  <div>
    <h1>{{ $attrs.entity.attributes.title }}</h1>
    <slot name="body" />
  <div>
</template>

See the Druxt Theming guide for more information.

Options

Druxt Entity options

These options are specific to this module.

OptionTypeRequiredDefaultDescription
entity.components.fieldsbooleanNotrueWhether to import deprecated default Field components.
entity.query.fieldsstring[]No[]An array of fields to filter all Entity JSON:API queries.
entity.query.schemabooleanNofalseWhether to automatically filter fields based on Display schema.

Base Druxt options

These options are available to all Druxt modules.

OptionTypeRequiredDefaultDescription
axiosobjectNo{}Axios instance settings.
baseUrlstringYesnullBase URL for the Drupal installation.

Keywords

FAQs

Package last updated on 12 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc